﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="load_video.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Certificate.load_video" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<body>
    <%
        var get_media = (from p in new TblLibraryController().FetchAll().Where(x=>x.LibraryType==3) orderby p.LibraryId descending select p).Take(12);
        foreach (TblLibrary video in get_media)
        {
            string date = DateTime.Parse(video.LibraryUploadDate.ToString()).Day.ToString() + "/" + DateTime.Parse(video.LibraryUploadDate.ToString()).Month.ToString() + "/" + DateTime.Parse(video.LibraryUploadDate.ToString()).Year.ToString();
            var get_upload = new TblManagerController().FetchAll().Where(x => x.ManagerId == video.LibraryUploader).Single();
    %>
    <div data-toggle="tooltip" data-placement="bottom" title="Đăng <%=date %> bởi <%=get_upload.FullName %>" class="media-item w3-quarter w3-center hvr-float">
        <div class="w3-hide media-link">https://www.youtube.com/embed/<%=video.LibraryLink %></div>
        <iframe width="100%" src="https://www.youtube.com/embed/<%=video.LibraryLink %>" frameborder="0" allowfullscreen></iframe>
        <br />
        <span><%=video.LibraryName %></span>
    </div>
    <%} %>
</body>
</html>
